package com.t7;
import static net.mindview.util.Print.*;

/**
 * Created by xuyiwei on 2018/7/19.
 */

class Insect {
    private int i =  printInit("static Insect.i initialized");;
    protected int j;
    Insect() {
        print("i = " + i + ", j = " + j);
        j = 39;
    }
    private static int x1 =
            printInit("static Insect.x1 initialized");
    static int printInit(String s) {
        print(s);
        return 47;
    }
}


public class Beetle extends Insect {
    private int k = printInit("Beetle.k initialized");
    public Beetle() {
        print("k = " + k);
        print("j = " + j);
    }
    private static int x2 =
            printInit("static Beetle.x2 initialized");
    public static void main(String[] args) {
        print("Beetle constructor");
        Beetle b = new Beetle();
    }
}



/**
 * Beetle constructor
 *static Insect.x1 initialized
 * i = 9 j=0
 *static Beetle.x2 initialized"
 *
 *Beetle.k initialized
 *k = 47
 * j=39
 *
 **/